//定义返回数据的基本模型
class BaseModel{
    constructor(data,message){
        if(typeof data === 'string'){
            this.message = data;
            data = null;
            message = null;
        }
        if(data) this.data = data;
        if(message) this.message = message;
    }
}

//成功的模型
class Successmodel extends BaseModel{
    constructor(data,message){
        super(data,message)
        this.errno = 0;
    }
}

//失败的模型
class Errormodel extends BaseModel{
    constructor(data,message){
        super(data,message)
        this.errno = -1;
    }
}

module.exports = {
    Successmodel,
    Errormodel
}
